/*
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
 *
 * This file is part of retabel.
 *
 * Copyright (c) 2011 by individual contributors as indicated by the
 * @author tags. See the copyright.txt file in the distribution
 * for a full listing of individual contributors.
 *
 * This is free software; you can redistribute it and/or modify it
 * under the terms of the GNU Lesser General Public License as
 * published by the Free Software Foundation; either version 2.1 of
 * the License, or (at your option) any later version.
 *
 * This software is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
 * Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public
 * License along with this software; if not, write to the Free
 * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
 * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
 */

package org.retabel.service.mapper;

import org.retabel.persistence.entity.document.SectionConfiguration;

import javax.ejb.Local;
import javax.xml.bind.JAXBElement;

/**
 * Class description.
 * <p/>
 * <h3>Extra-Info</h3>
 * Created: 16:20 12.08.11
 *
 * @author Peter Herber
 * @version 1.0
 */
@Local
public interface XmlSectionConfigurationMapper {

    /**
     * Parsing method to create a {@linkplain org.retabel.persistence.entity.document.SectionConfiguration} from a given xml
     * configuration.
     *
     * @param sectionConfigurationData the xml configuration data.
     * @return an instance of {@linkplain org.retabel.persistence.entity.document.SectionConfiguration}.
     * @throws XmlConfigurationMappingException if the configuration can't parsed.
     */
    SectionConfiguration unmarshal(byte[] sectionConfigurationData) throws XmlConfigurationMappingException;

    /**
     * Marshal method to create a {@linkplain JAXBElement<xsd.sectionconfiguration.SectionConfiguration>} from a given section configuration entity
     * @param sectionConfiguration the section configuration entity
     * @return an instance of {@linkplain JAXBElement<xsd.sectionconfiguration.SectionConfiguration>}.
     */
    JAXBElement<xsd.sectionconfiguration.SectionConfiguration> marshal(SectionConfiguration sectionConfiguration);

    /**
     * Mapping method, creates a new section configuration entity mapping report design and export configuration references against
     * existing entities
     * @param sectionConfiguration the xml section configuration the section configuration entity is mapped for
     * @return a section configuration entity referencing all required report design and export configurations
     * @throws XmlConfigurationMappingException if the configuration can't parsed.
     */
    SectionConfiguration mapSectionConfiguration(xsd.sectionconfiguration.SectionConfiguration sectionConfiguration)
        throws XmlConfigurationMappingException;
}
